// import React from 'react';
// import ReactDOM from 'react-dom/client';
import './index.css';
// import HomePage from './pages/hp';
// import Login from './pages/login';
import dva from "dva"
import router from "./router/router"
import Global from './model/global';
import 'antd/dist/antd.css'


// const root = ReactDOM.createRoot(document.getElementById('root'));
// root.render(
//   <>
//     {/* <HomePage /> */}
//     <Login />
//   </>
// );


// 1. 初始化dva
// const app =dva()
const app = dva({
  initialState: {
    global: JSON.parse(localStorage.getItem('global') || "{}")
  },
  onStateChange(data) {
    localStorage.setItem('global', JSON.stringify(data.global))
  },
});
// 挂载路由
app.router(router)
// 挂载redux
app.model(Global)
// 启动
app.start("#root")